import React from "react";
import ReactDOM from "react-dom";

class Demo extends React.Component {
  state = {
    count: 0
  }

  render() {
    return (
      <div>
        <h2>{this.state.count}</h2>
        {/* this.setState({ count: this.state.count + 1 }) */}
        <button onClick={()=> this.setState({ count: this.state.count+1 })}>anniu</button>
      </div>
    )
  }
}

ReactDOM.render(<Demo />,document.getElementById('root'))